<div class="xiedingfang">
    <div class="search">
      <h1 class="afterClean">
        <img src="/assets/main/basic-database/bg28.jpg" />
        <!-- <button>批量打回</button> -->
      </h1>
      <div class="searchBox afterClean">
        <ul class="afterClean">
          <li>
            <label>方名：</label>
            <input nv-input type="text" [(ngModel)]="name">
          </li>
          <li>
            <label>药物：</label>
            <input nv-input type="text" [(ngModel)]="drug">
          </li>
          <li>
            <label>类型：</label>
            <input nv-input type="text" [(ngModel)]="type">
          </li>
        </ul>
        <button class="searchBtn" (click)="search()"></button>
      </div>
  
    </div>
    <div class="content">
      <div class="tableWrap">
        <!-- <button class='deleteAll' *ngIf="indeterminate||allChecked" (click)="deleteAll()"></button> -->
        <nv-table #messagesTable [nvData]="messages" [nvFrontPagination]="false" [nvLoading]="false" [nvNoResult]="noResult"
          (nvCurrentPageDataChange)="messageChanged($event)" [nvShowPagination]="false" [nvFooter]="tableFooterTemplate">
          <thead *ngIf="messages&&messages.length>0">
            <tr>
              <!-- <th nvShowCheckbox [(nvChecked)]="allChecked" [nvIndeterminate]="indeterminate"
                          (nvCheckedChange)="checkAll($event)">序号</th> -->
              <th>序号</th>
              <th>方名</th>
              <th>组成</th>
              <th>类型</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody #messagesBody>
            <tr *ngFor="let message of messagesTable.data;let i = index;" #messagesTr>
              <td nvShowCheckbox [(nvChecked)]="message.checked" [nvDisabled]="message.disabled" (nvCheckedChange)="refreshStatus($event)">
                {{(currentPage-1)*20+i+1}}
              </td>
              <td>{{message['方名']}}</td>
              <td><p class="width">{{message['组成']}}</p></td>
              <td>{{message['类型']}}</td>
              <td><button (click)="goToDetail(message['_id'])">查看</button></td>
            </tr>
          </tbody>
        </nv-table>
        <ng-template #noResult>
          <h2 class="noResult">暂无数据</h2>
        </ng-template>
        <ng-template #tableFooterTemplate class="tableFooterPart">
          <div *ngIf="messagesTable.data.length>0" class="pagination">
            <button class="backToFirstBtn" (click)="currentPage=1;getList();">首页</button>
            <button class="beforePage" (click)="goToBeforePage()">上一页</button>
            <button class="nextPage" (click)="goToNextPage()">下一页</button>
            <button class="backToLastBtn" (click)="currentPage=total_pages;getList();">尾页</button>
            <!-- <nv-pagination [nvTotal]="total_results" [(nvPageIndex)]="currentPage" (nvPageIndexChange)="getList()"></nv-pagination> -->
            <span class="totalText">页次：<i class="currentPage">{{currentPage}}</i>/<i class="totalPages">{{total_pages}}</i>页</span>
            <span class="totalResults">共<i>{{total_results}}</i>条记录</span>
            <span class="perPage"><i>20</i>条记录/页</span>
            <span>转到：</span>
            <nv-input-group class="pageJumpInputGroup">
              <input type="number" nv-input min="1" max="{{total_pages}}" [(ngModel)]="targetPage" (keydown.enter)="JumpToTargetPage()">
            </nv-input-group>
            <button class="pageJumpConfirmBtn" (click)="JumpToTargetPage()">Goto</button>
          </div>
        </ng-template>
      </div>
    </div>
    <div class="footer">
      上海市中医文献馆版权所有
    </div>
  </div>
  